#include "stdafx.h"
#include "queue.h"
#include "object.h"
#include "timer.h"
#include "message.h"
#include "master.h"
#include "hero.h"
#include "display.h"

#include "Array3D.h"
#include "matrix.h"

#include "terminator.h"
// for memory leaks finding
#include <debug_new.h>
//



int main(int argc, char* argv[])
{
	int xsize = 3;
	int ysize = 3;
	int zsize = 3;

	CArray3D* cube = new CArray3D(3,3,3);

	for(int k=0; k < zsize; k++)
		for(int j=0; j < ysize; j++)
			for(int i=0; i < xsize; i++)
				(*cube)(i,j,k)=i+k;

	CArray3D* rotatedCube = new CArray3D(zsize, ysize, xsize);
	for(int i=0; i < xsize; i++)
		for(int j=0; j < ysize; j++)
			for(int k=0; k < zsize; k++)
					(*rotatedCube)(j, xsize-i-1, k) = (*cube)(i,j,k);

	for(int k=0; k < zsize; k++)
	{
		for(int j=ysize-1; j>=0; j--)
		{
			for(int i=0; i < xsize; i++)
				cout << (*cube)(i,j,k) << " ";
			
			cout << endl;
		}
		cout << endl << endl;
	}


	for(int k=0; k < zsize; k++)
	{
		for(int j=ysize-1; j>=0; j--)
		{
			for(int i=0; i < xsize; i++)
				cout << (*rotatedCube)(i,j,k) << " ";
			
			cout << endl;
		}
		cout << endl << endl;
	}

	delete cube;
	delete rotatedCube;
/*
	CQueueParser parser;
	
	CObject *o1,*o2, *o3, *o4, *o5;
	o1 = new CTimer;
	o2 = new CMaster;
	o3 = new CHero;
	o4 = new CDisplay;
	o5 = new CTerminator(10);
	parser.addObject("Timer",o1);
	parser.addObject("Master",o2);
	parser.addObject("Hero",o3);
	parser.addObject("Display",o4);
	parser.addObject("Terminator",o5);

	vector<Message> mv;
//	Message m("Master","All",MSG_GET_MSG);
//	mv.push_back(m);
	
	parser.parse(mv);

	system("cls");

*/
	return 0;
}